<form name="passwordForm" class="security" ng-init="dvm.init()" ng-submit="dvm.save(passwordForm.$valid)" novalidate>
  <div class="modal-header">
    <button type="button" class="close" ng-click="dvm.cancel()">&times;</button>
    <h4 class="modal-title">修改密码</h4>
  </div>
  <div class="modal-body">
    <div class="form-group">
      <input name="oldPassword" type="password" class="form-control" ng-model="dvm.oldPassword" placeholder="旧密码"
          required ng-class="{'invalid': passwordForm.$submitted && passwordForm.oldPassword.$invalid}" autofocus>
      <p class="text-danger" ng-show="passwordForm.$submitted && passwordForm.oldPassword.$error.required">旧密码不能为空</p>
    </div>
    <div class="form-group">
      <input name="password" type="password" class="form-control" ng-model="dvm.password" placeholder="新密码"
          required ng-class="{'invalid': passwordForm.$submitted && passwordForm.password.$invalid}">
      <p class="text-danger" ng-show="passwordForm.$submitted && passwordForm.password.$error.required">新密码不能为空</p>
    </div>
    <div class="form-group">
      <input name="cfmPassword" type="password" class="form-control" ng-model="dvm.cfmPassword" placeholder="确认新密码"
          required ng-class="{'invalid': passwordForm.$submitted && passwordForm.cfmPassword.$invalid}">
      <p class="text-danger" ng-show="passwordForm.$submitted && passwordForm.cfmPassword.$error.required">确认新密码不能为空</p>
      <p class="text-danger" ng-show="passwordForm.$submitted && dvm.cfmPassword && dvm.cfmPassword != dvm.password">两次输入的新密码不一致</p>
    </div>
    <div class="form-group">
      <input name="captcha" type="text" class="form-control" ng-model="dvm.captcha" placeholder="验证码"
          required ng-class="{'invalid': passwordForm.$submitted && passwordForm.captcha.$invalid}">
      <p class="text-danger" ng-show="passwordForm.$submitted && passwordForm.captcha.$error.required">验证码不能为空</p>
    </div>
    <div class="form-group captcha">
      <img ng-src="{{'/note/auth/captcha?id=' + dvm.randomId}}" ng-click="dvm.changeRandomId()" title="点击切换验证码">
    </div>
  </div>
  <div class="modal-footer">
    <button type="submit" class="btn btn-default" ng-disabled="passwordForm.$invalid">
      <i class="fa fa-save"></i> 保存</button>
    <button type="button" class="btn btn-default" ng-click="dvm.cancel()">
      <i class="fa fa-times"></i> 取消</button>
  </div>
</form>
